extends AnimatableBody2D

## 生存事件
var death_time=0

func _ready():
	death_time = Time.get_ticks_msec() + 2000
	
func _process(delta):
	if Time.get_ticks_msec() >= death_time:
		queue_free()
		
func _physics_process(delta):
	# 火球移动距离
	var distance:Vector2 =Vector2.RIGHT * 1000 * delta
	var collision = move_and_collide(distance)
	
	if collision:
		queue_free()
		if collision.get_collider().is_in_group('enemy'):
			collision.get_collider().die()
